﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace VolunteerHub.Data.Api
{
    public class AnswerConverter: VolunteerHubAdapter.JsonCreationConverter<FormAnswer>
    {
        protected override Type GetType(Type objectType, Newtonsoft.Json.Linq.JObject jObject)
        {
            var type = (string)jObject.Property("$type");

            return VolunteerHubAdapter.VolunteerHubHelper.GetAnswerType(type);
        }

        public override void WriteJson(Newtonsoft.Json.JsonWriter writer, object value, Newtonsoft.Json.JsonSerializer serializer)
        {
            throw new NotImplementedException();
        }
    }
}
